export const NUMBERS = Array.from({ length: 49 }, (_, index) => index + 1)

// codemirror 配置
export const CODEMIRROR_OPTIONS = {
  mode: 'javascript', // 语言模式
  theme: 'material', // 主题
  lineNumbers: true, // 显示行号
  lineHeight: 1.5 // 行高
}

// 目录选项
export const FOLDER_OPTIONS = [
  'two',
  'three',
  'four',
  'five',
  'six',
  'seven',
  'eight',
  'ten',
  'twelve',
  'sixteen',
  'twentyfour'
]

// // 动态生成多个文件夹的映射
// const folderRangeMaps = FOLDER_OPTIONS.reduce((acc, folder) => {
//   const rangeMap = Object.fromEntries(
//     Array.from({ length: 1500 }, (_, i) => {
//       const key = `${folder.toUpperCase()}_RANGE_${String(i + 1).padStart(8, '0')}_GROUPS`
//       const value = `http://localhost:9527/#/${folder}/range-${String(i + 1).padStart(8, '0')}`
//       return [key, value]
//     })
//   )

//   // 将生成的 rangeMap 添加到最终结果中
//   acc[folder] = rangeMap

//   return acc
// }, {})

// console.log('folderRangeMaps', folderRangeMaps)

// 动态生成所有文件夹的平铺映射
const folderRangeMaps = FOLDER_OPTIONS.reduce((acc, folder) => {
  // 创建当前文件夹的 rangeMap
  const rangeMap = Object.fromEntries(
    Array.from({ length: 1500 }, (_, i) => {
      const key = `${folder.toUpperCase()}_RANGE_${String(i + 1).padStart(8, '0')}_GROUPS`
      const value = `http://localhost:9527/#/${folder}/range-${String(i + 1).padStart(8, '0')}`
      return [key, value]
    })
  )

  // 将当前文件夹的 rangeMap 合并到最终结果中
  return { ...acc, ...rangeMap }
}, {})

// 色区间 https://ant.design/docs/spec/colors-cn
export const COLORS = [
  // '#4096ff', // 蓝 blue-6
  // '#a0d911', // 绿 lime-6
  // '#fadb14', // 黄 yellow-6
  // '#f5222d', // 红 red-6
  // '#722ed1', // 紫 purple-6

  // '#bae0ff', // 蓝 blue-2
  // '#f4ffb8', // 绿 lime-2
  // '#ffffb8', // 黄 yellow-2
  // '#ffccc7', // 红 red-2
  // '#efdbff', // 紫 purple-2

  //   '#69b1ff', // 蓝 blue-4
  //   '#d3f261', // 绿 lime-4
  //   '#fff566', // 黄 yellow-4
  //   '#ff7875', // 红 red-4
  //   '#b37feb' // 紫 purple-4

  // for g2 charts
  // '#d44654',
  // '#e45c53',
  // '#ef7252',
  // '#f78958',
  // '#faa363',
  // '#fdbc73',
  // '#fed185',
  // '#fee398',
  // '#fef1aa',
  // '#fbf9b4',
  // '#f4fab0',
  // '#e7f5a7',
  // '#d4eda3',
  // '#bbe4a6',
  // '#a0d9a8',
  // '#85ccab',
  // '#6abcae',
  // '#55a6b5'

  // for antv 色板
  // '#5b8ef8',
  // '#94b2f2',
  // '#e0e3ea',
  // '#f7ae9c',
  // '#e8694a'

  // for echarts 漏斗图
  '#fbd88a', //  （浅黄色）
  '#f39393', //  （浅红色）
  '#9dd2e7', //  （浅蓝色）
  '#b2db9e', //  （浅绿色）
  '#879ad7' //  （中蓝色）
]

export const COLORS_2 = [
  // "#d44654", "#db5154", "#e45c53", "#ea6653", "#ef7252", "#f57c53", "#f78958", "#f9925c",
  // "#faa363", "#fbb06a", "#fdbc73", "#fdc87a", "#fed185", "#fee093", "#fee398", "#fef1aa",
  // "#fdf6ad", "#fbf9b4", "#f6f9b2", "#f4fab0", "#eef8aa", "#e7f5a7", "#ddeeaa", "#d4eda3",
  // "#cce9a4", "#bbe4a6", "#aedfa7", "#a0d9a8", "#96d1a9", "#85ccab", "#7ac4ab", "#6abcae",
  // "#5db3b0", "#55a6b5", "#4a99b7", "#4090b8", "#3788ba", "#317fb9", "#2a76b7", "#246cb6",
  // "#2061b4", "#1d56b1", "#1a4bae", "#1741ab", "#1537a7", "#132da4", "#1023a0", "#0d189c",
  // "#0a0e98"

  '#d44654',
  '#e45c53',
  '#ef7252',
  '#f78958',
  '#faa363',
  '#fdbc73',
  '#fed185',
  '#fee398',
  '#fef1aa',
  '#fbf9b4',
  '#f4fab0',
  '#e7f5a7',
  '#d4eda3',
  '#bbe4a6',
  '#a0d9a8',
  '#85ccab',
  '#6abcae',
  '#55a6b5'
]

// todo cyan: g2图例
// https://g2.antv.antgroup.com/examples/general/cell#cell-aggregated
// https://g2.antv.antgroup.com/examples/geo/geo#hexbin-china
// https://g2.antv.antgroup.com/examples/general/radial#apple-activity
// https://g2.antv.antgroup.com/examples/general/interval#bar-stacked-diverging-rounded
// https://g2.antv.antgroup.com/zh/examples/general/point/#point-aggregated

// todo cyan: antd 分类色板
// https://ant.design/docs/spec/visual-cn
// https://antv.antgroup.com/specification/language/palette
// https://g6.antv.antgroup.com/zh/examples/case/graphDemos/#decisionBubbles

// todo cyan: antv s2 table
// https://s2.antv.antgroup.com/zh/examples/interaction/basic/#hover

// other
// https://cui.antfact.com/guide/ed/color/dev
// https://echarts.apache.org/examples/zh/editor.html?c=candlestick-simple

export const ROUTER_MAP = {
  TWO_ASCENDING_GROUPS: 'http://localhost:9527/#/two/ascending',
  TWO_ODD_EVEN_GROUPS: 'http://localhost:9527/#/two/odd-even',
  TWO_PRIME_GROUPS: 'http://localhost:9527/#/two/prime',
  TWO_MIRROR_GROUPS: 'http://localhost:9527/#/two/mirror',
  TWO_MODULO_THREE_GROUPS: 'http://localhost:9527/#/two/modulo-three',
  TWO_FIBONACCI_GROUPS: 'http://localhost:9527/#/two/fibonacci',
  TWO_DIAGONAL_GROUPS: 'http://localhost:9527/#/two/diagonal',
  TWO_GOLDEN_GROUPS: 'http://localhost:9527/#/two/golden',
  TWO_SKIP_GROUPS: 'http://localhost:9527/#/two/skip',

  THREE_ASCENDING_GROUPS: 'http://localhost:9527/#/three/ascending',
  THREE_ODD_EVEN_GROUPS: 'http://localhost:9527/#/three/odd-even',
  THREE_MODULO_THREE_GROUPS: 'http://localhost:9527/#/three/modulo-three',
  THREE_PRIME_NONPRIME_GROUPS: 'http://localhost:9527/#/three/prime',
  THREE_MANTISSA_GROUPS: 'http://localhost:9527/#/three/mantissa',
  THREE_SYMMETRIC_GROUPS: 'http://localhost:9527/#/three/symmetric',
  THREE_SKIPPED_GROUPS: 'http://localhost:9527/#/three/skipped',
  TEN_DIAGONAL_GROUPS: 'http://localhost:9527/#/ten/diagonal',

  FOUR_ASCENDING_GROUPS: 'http://localhost:9527/#/four/ascending',
  FOUR_ODD_EVEN_GROUPS: 'http://localhost:9527/#/four/odd-even',
  FOUR_MANTISSA_GROUPS: 'http://localhost:9527/#/four/mantissa',
  FOUR_SKIPPED_GROUPS: 'http://localhost:9527/#/four/skipped',
  FOUR_PRIME_GROUPS: 'http://localhost:9527/#/four/prime',
  FOUR_CROSS_MANTISSA_GROUPS: 'http://localhost:9527/#/four/cross-mantissa',
  FOUR_CUMULATIVE_SUM_GROUPS: 'http://localhost:9527/#/four/cumulative-sum',
  FOUR_MIRROR_GROUPS: 'http://localhost:9527/#/four/mirror',
  FOUR_PRIME_COMPOSITE_GROUPS: 'http://localhost:9527/#/four/prime-composite',
  FOUR_DOUBLE_ALTERNATE_GROUPS: 'http://localhost:9527/#/four/double-alternate',
  FOUR_SYMMETRIC_TAIL_EXPANSION_GROUPS: 'http://localhost:9527/#/four/symmetric-tail-expansion',
  FOUR_SKIPPED_SUM_GROUPS: 'http://localhost:9527/#/four/skipped-sum',
  FOUR_CENTER_SYMMETRIC_GROUPS: 'http://localhost:9527/#/four/center-symmetric',
  FOUR_ODD_EVEN_SYMMETRIC_GROUPS: 'http://localhost:9527/#/four/oddeven-symmetric',
  FOUR_QUADRANT_GROUPS: 'http://localhost:9527/#/four/quadrant',
  FOUR_PYRAMID_GROUPS: 'http://localhost:9527/#/four/pyramid',
  FOUR_INVERTED_PYRAMID_GROUPS: 'http://localhost:9527/#/four/inverted-pyramid',
  FOUR_FOLDBACK_GROUPS: 'http://localhost:9527/#/four/fold-back',
  FOUR_DIAGONAL_GROUPS: 'http://localhost:9527/#/four/diagonal',
  FOUR_DIFFERENCE_GROUPS: 'http://localhost:9527/#/four/difference',

  FIVE_MANTISSA_GROUPS: 'http://localhost:9527/#/five/mantissa',
  FIVE_ASCENDING_GROUPS: 'http://localhost:9527/#/five/ascending',
  FIVE_PRIME_GROUPS: 'http://localhost:9527/#/five/prime',
  FIVE_FIBONACCI_GROUPS: 'http://localhost:9527/#/five/fibonacci',
  FIVE_DIFFERENCE_GROUPS: 'http://localhost:9527/#/five/difference',
  FIVE_CENTER_EXPANSION_GROUPS: 'http://localhost:9527/#/five/center-expansion',
  FIVE_LARGE_MID_SMALL_GROUPS: 'http://localhost:9527/#/five/large-mid-small',
  FIVE_QUADRANT_GROUPS: 'http://localhost:9527/#/five/quadrant',
  FIVE_PYRAMID_GROUPS: 'http://localhost:9527/#/five/pyramid',
  FIVE_FOLD_BACK_GROUPS: 'http://localhost:9527/#/five/fold-back',
  FIVE_JUMP_TWO_GROUPS: 'http://localhost:9527/#/five/jump-two',
  FIVE_MODULO_THREE_GROUPS: 'http://localhost:9527/#/five/modulo-three',
  FIVE_JUMP_THREE_GROUPS: 'http://localhost:9527/#/five/jump-three',
  FIVE_JUMP_FOUR_GROUPS: 'http://localhost:9527/#/five/jump-four',
  FIVE_JUMP_FIVE_GROUPS: 'http://localhost:9527/#/five/jump-five',

  SIX_ASCENDING_GROUPS: 'http://localhost:9527/#/six/ascending',
  SIX_ODD_EVEN_GROUPS: 'http://localhost:9527/#/six/odd-even',
  SIX_PRIME_GROUPS: 'http://localhost:9527/#/six/prime',
  SIX_MODULO_SEVEN_GROUPS: 'http://localhost:9527/#/six/module-seven',
  SIX_MANTISSA_GROUPS: 'http://localhost:9527/#/six/mantissa',
  SIX_MIRROR_GROUPS: 'http://localhost:9527/#/six/mirror',
  SIX_ALTERNATE_GROUPS: 'http://localhost:9527/#/six/alternate',
  SIX_FIBONACCI_GROUPS: 'http://localhost:9527/#/six/fibonacci',
  SIX_MODULO_THREE_GROUPS: 'http://localhost:9527/#/six/modulo-three',
  SIX_MULTIPLE_GROUPS: 'http://localhost:9527/#/six/multiple',
  SIX_OFFSET_MANTISSA_GROUPS: 'http://localhost:9527/#/six/offset-mantissa',
  SIX_QUADRANT_GROUPS: 'http://localhost:9527/#/six/quadrant',
  SIX_MULTIPLE_SKIP_GROUPS: 'http://localhost:9527/#/six/multiple-skip',
  SIX_SUM_DIFFERENCE_GROUPS: 'http://localhost:9527/#/six/sum-difference',
  SIX_TWIN_GROUPS: 'http://localhost:9527/#/six/twin',
  SIX_PYRAMID_GROUPS: 'http://localhost:9527/#/six/pyramid',
  SIX_INCREMENTAL_SUM_GROUPS: 'http://localhost:9527/#/six/incremental-sum',
  SIX_SKIPPED_ODD_EVEN_GROUPS: 'http://localhost:9527/#/six/skipped-oddeven',

  SEVEN_ASCENDING_GROUPS: 'http://localhost:9527/#/seven/ascending',
  SEVEN_ODD_EVEN_GROUPS: 'http://localhost:9527/#/seven/odd-even',
  SEVEN_PRIME_GROUPS: 'http://localhost:9527/#/seven/prime',
  SEVEN_MANTISSA_GROUPS: 'http://localhost:9527/#/seven/mantissa',
  SEVEN_PYRAMID_GROUPS: 'http://localhost:9527/#/seven/pyramid',
  SEVEN_MODULO_SEVEN_GROUPS: 'http://localhost:9527/#/seven/module-seven',
  SEVEN_FIBONACCI_GROUPS: 'http://localhost:9527/#/seven/fibonacci',
  SEVEN_DIAGONAL_GROUPS: 'http://localhost:9527/#/seven/diagonal',
  SEVEN_MULTIPLE_GROUPS: 'http://localhost:9527/#/seven/multiple',
  SEVEN_SUM_DIFFERENCE_GROUPS: 'http://localhost:9527/#/seven/sum-difference',
  SEVEN_QUADRANT_GROUPS: 'http://localhost:9527/#/seven/quadrant',
  SEVEN_CENTER_EXPANSION_GROUPS: 'http://localhost:9527/#/seven/center-expansion',
  SEVEN_MIRROR_GROUPS: 'http://localhost:9527/#/seven/mirror',
  SEVEN_MODULO_THREE_GROUPS: 'http://localhost:9527/#/seven/modulo-three',

  EIGHT_ASCENDING_GROUPS: 'http://localhost:9527/#/eight/ascending',
  EIGHT_ODD_EVEN_GROUPS: 'http://localhost:9527/#/eight/odd-even',
  EIGHT_PRIME_GROUPS: 'http://localhost:9527/#/eight/prime',
  EIGHT_MANTISSA_GROUPS: 'http://localhost:9527/#/eight/mantissa',
  EIGHT_PYRAMID_GROUPS: 'http://localhost:9527/#/eight/pyramid',
  EIGHT_MODULO_FOUR_GROUPS: 'http://localhost:9527/#/eight/modulo-four',
  EIGHT_FIBONACCI_GROUPS: 'http://localhost:9527/#/eight/fibonacci',
  EIGHT_DIFFERENCE_GROUPS: 'http://localhost:9527/#/eight/difference',
  EIGHT_QUADRANT_GROUPS: 'http://localhost:9527/#/eight/quadrant',
  EIGHT_CENTER_EXPANSION_GROUPS: 'http://localhost:9527/#/eight/center-expansion',
  EIGHT_JUMP_THREE_GROUPS: 'http://localhost:9527/#/eight/jump-three',
  EIGHT_LAST_DIGIT_GROUPS: 'http://localhost:9527/#/eight/last-digit',
  EIGHT_DIAGONAL_GROUPS: 'http://localhost:9527/#/eight/diagonal',
  EIGHT_MIRROR_GROUPS: 'http://localhost:9527/#/eight/mirror',
  EIGHT_MULTIPLE_GROUPS: 'http://localhost:9527/#/eight/multiple',
  EIGHT_SYMMETRIC_CENTER_GROUPS: 'http://localhost:9527/#/eight/symmetric-center',

  TEN_HEAD_GROUPS: 'http://localhost:9527/#/ten/head',
  TEN_PRIME_GROUPS: 'http://localhost:9527/#/ten/prime',
  TEN_ODD_EVEN_GROUPS: 'http://localhost:9527/#/ten/odd-even',
  TEN_FIBONACCI_GROUPS: 'http://localhost:9527/#/ten/fibonacci',
  TEN_STAGGERED_GROUPS: 'http://localhost:9527/#/ten/staggered',
  TEN_DIFFERENCE_GROUPS: 'http://localhost:9527/#/ten/difference',
  TEN_CENTER_EXPANSION_GROUPS: 'http://localhost:9527/#/ten/center-expansion',
  TEN_LARGE_MID_SMALL_GROUPS: 'http://localhost:9527/#/ten/large-mid-small',
  TEN_QUADRANT_GROUPS: 'http://localhost:9527/#/ten/quadrant',
  TEN_PYRAMID_GROUPS: 'http://localhost:9527/#/ten/pyramid',
  TEN_CROSSING_GROUPS: 'http://localhost:9527/#/ten/crossing',
  TEN_JUMP_THREE_GROUPS: 'http://localhost:9527/#/ten/jump-three',
  TEN_JUMP_FOUR_GROUPS: 'http://localhost:9527/#/ten/jump-four',
  TEN_JUMP_FIVE_GROUPS: 'http://localhost:9527/#/ten/jump-five',
  TEN_JUMP_SIX_GROUPS: 'http://localhost:9527/#/ten/jump-six',
  TEN_ALTERNATING_GROUPS: 'http://localhost:9527/#/ten/alternating',

  TWELVE_ASCENDING_GROUPS: 'http://localhost:9527/#/twelve/ascending',
  TWELVE_ODD_EVEN_GROUPS: 'http://localhost:9527/#/twelve/odd-even',
  TWELVE_PRIME_GROUPS: 'http://localhost:9527/#/twelve/prime',
  TWELVE_MODULO_FOUR_GROUPS: 'http://localhost:9527/#/twelve/modulo-four',
  TWELVE_FIBONACCI_GROUPS: 'http://localhost:9527/#/twelve/fibonacci',
  TWELVE_MANTISSA_GROUPS: 'http://localhost:9527/#/twelve/mantissa',
  TWELVE_CENTER_EXPANSION_GROUPS: 'http://localhost:9527/#/twelve/center-expansion',
  TWELVE_DIFFERENCE_GROUPS: 'http://localhost:9527/#/twelve/difference',
  TWELVE_QUADRANT_GROUPS: 'http://localhost:9527/#/twelve/quadrant',
  TWELVE_PYRAMID_GROUPS: 'http://localhost:9527/#/twelve/pyramid',
  TWELVE_MIRROR_GROUPS: 'http://localhost:9527/#/twelve/mirror',
  TWELVE_MODULO_THREE_GROUPS: 'http://localhost:9527/#/twelve/modulo-three',
  TWELVE_SUM_DIFFERENCE_GROUPS: 'http://localhost:9527/#/twelve/sum-difference',
  TWELVE_MULTIPLE_GROUPS: 'http://localhost:9527/#/twelve/multiple',
  TWELVE_JUMP_THREE_GROUPS: 'http://localhost:9527/#/twelve/jump-three',
  TWELVE_LARGE_MID_SMALL_GROUPS: 'http://localhost:9527/#/twelve/large-mid-small',

  SIXTEEN_ASCENDING_GROUPS: 'http://localhost:9527/#/sixteen/ascending',
  SIXTEEN_PRIME_GROUPS: 'http://localhost:9527/#/sixteen/prime',
  SIXTEEN_FIBONACCI_GROUPS: 'http://localhost:9527/#/sixteen/fibonacci',
  SIXTEEN_CENTER_EXPANSION_GROUPS: 'http://localhost:9527/#/sixteen/center-expansion',
  SIXTEEN_LARGE_MID_SMALL_GROUPS: 'http://localhost:9527/#/sixteen/large-mid-small',
  SIXTEEN_PYRAMID_GROUPS: 'http://localhost:9527/#/sixteen/pyramid',
  SIXTEEN_QUADRANT_GROUPS: 'http://localhost:9527/#/sixteen/quadrant',
  SIXTEEN_JUMP_TWO_GROUPS: 'http://localhost:9527/#/sixteen/jump-two',
  SIXTEEN_MODULO_FOUR_GROUPS: 'http://localhost:9527/#/sixteen/modulo-four',
  SIXTEEN_MIRROR_GROUPS: 'http://localhost:9527/#/sixteen/mirror',
  SIXTEEN_CROSSING_GROUPS: 'http://localhost:9527/#/sixteen/crossing',
  SIXTEEN_SUM_DIFFERENCE_GROUPS: 'http://localhost:9527/#/sixteen/sum-difference',
  SIXTEEN_DIAGONAL_GROUPS: 'http://localhost:9527/#/sixteen/diagonal',
  SIXTEEN_LAST_DIGIT_GROUPS: 'http://localhost:9527/#/sixteen/last-digit',
  SIXTEEN_MODULO_THREE_GROUPS: 'http://localhost:9527/#/sixteen/modulo-three',
  SIXTEEN_MULTIPLE_GROUPS: 'http://localhost:9527/#/sixteen/multiple',

  TWENTYFOUR_ASCENDING_25_LT_GROUPS: 'http://localhost:9527/#/twentyfour/ascending-lt',
  TWENTYFOUR_ASCENDING_25_GT_GROUPS: 'http://localhost:9527/#/twentyfour/ascending-gt',
  TWENTYFOUR_ODD_EVEN_GROUPS: 'http://localhost:9527/#/twentyfour/odd-even',
  TWENTYFOUR_CENTER_EXPANSION_LT_GROUPS: 'http://localhost:9527/#/twentyfour/center-expansion-lt',
  TWENTYFOUR_CENTER_EXPANSION_GT_GROUPS: 'http://localhost:9527/#/twentyfour/center-expansion-gt',
  TWENTYFOUR_PRIME_LT_GROUPS: 'http://localhost:9527/#/twentyfour/prime-lt',
  TWENTYFOUR_PRIME_GT_GROUPS: 'http://localhost:9527/#/twentyfour/prime-gt',
  TWENTYFOUR_LAST_DIGIT_GROUPS: 'http://localhost:9527/#/twentyfour/last-digit',
  TWENTYFOUR_MODULO_THREE_GROUPS: 'http://localhost:9527/#/twentyfour/modulo-three',

  ...folderRangeMaps
}

export const ACCURACY_SUMMARY_CN_MAP = {
  count: '统计次数',
  correctCount: '正确次数',
  incorrectCount: '错误次数',
  accuracyRate: '准确率',
  maxConsecutiveCorrect: '最大连续正确次数',
  maxConsecutiveIncorrect: '最大连续错误次数',
  consecutiveCorrectSegments: '连续正确段数',
  consecutiveIncorrectSegments: '连续错误段数',
  avgConsecutiveCorrect: '平均连续正确次数',
  avgConsecutiveIncorrect: '平均连续错误次数',
  currentConsecutiveCorrect: '当前连续正确次数',
  currentConsecutiveIncorrect: '当前连续错误次数'
}
